package com.springboot.demo.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@Controller
@Api(description = "好类来的")
public class HelloWorldController {
    @ApiOperation(value="获取hello的id", notes="根据url的id来获取用户详细信息")
    @ApiImplicitParam(name = "id", value = "用户ID", paramType = "path")
    @RequestMapping(value = "index/{id}",method = RequestMethod.POST)
    public String nice(@PathVariable(value = "id",required = false) Integer id){
        return "Hello  sb!!" + id;
    }
    @RequestMapping(value="first",method = RequestMethod.GET)
    public String hello(){
        return "hello";
    }
}
